package Test;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import DB.ConnectionManager;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ConnectionManager mgr = ConnectionManager.getInstance();
		Connection con = mgr.getConnection();
		
		try {
			Statement st = con.createStatement() ;
			st.executeUpdate("insert into student (name , address , phone) values ('joe', 'abcd' , 54545)");
			ResultSet rs = st.executeQuery("select * from STUDENT");
			
			while (rs.next()) {
				System.out.println(rs.getString(1)+" "+ rs.getString(2) +" "+ rs.getInt(3));
			}
			rs.close();
			st.close();
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		mgr.closeConnection(con);
	}

}
